import request from '@/utils/request'

const api = {
  getEqList: '/equipment/get_eqlists',
  getEqlistsPageUrl: '/equipment/get_eqlists_page',
  getEqTypesUrl: '/equipment/get_eq_types',
  addEquipDocUrl: '/equipment/add_equip',
  updateEquipDocUrl: '/equipment/update_equipDoc',
  deleteEquipDocUrl: '/equipment/delete_equipdoc',
  addRepairPartUrl: '/equip_repair/add_repair_part',
  getRepairPartUrl: '/equip_repair/get_repair_part',
  changeRepairPartUrl: '/equip_repair/change_repair_part',
  deleteRepairPartUrl: '/equip_repair/delete_repair_part',
  getRepairReasonUrl: '/equip_repair/get_repair_reason',
  addRepairReasonUrl: '/equip_repair/add_repair_reason',
  updateRepairReasonUrl: '/equip_repair/update_repair_reason',
  deleteRepairReasonUrl: '/equip_repair/delete_repair_reason',
  getRepairBillUrl: '/equip_repair/get_repair_bill',
  getEquipRepairPageUrl: '/equip_repair/get_equip_repair_page',
  getSgInfoUrl: '/equipment/get_sg_info',

  reportRepairUrl: '/equip_repair/report_repair',
  shanggongUrl: '/equipment/shanggong',
  shangFuzhuUserBatchUrl: '/equipment/shang_fuzhu_user_batch',
  xiaFuzhuUrl: '/equipment/xia_fuzhu',
  xiagongUrl: '/equipment/xiagong',
}

export async function xiagongApi(data: Map<string, any>) {
  const res = await request({
    url: api.xiagongUrl,
    method: 'post',
    data,
  })
  return res
}

export async function xiaFuzhuApi(data: Map<string, any>) {
  const res = await request({
    url: api.xiaFuzhuUrl,
    method: 'post',
    data,
  })
  return res
}

export async function shangFuzhuUserBatchApi(data: Map<string, any>) {
  const res = await request({
    url: api.shangFuzhuUserBatchUrl,
    method: 'post',
    data,
  })
  return res
}

export async function shanggongApi(data: Map<string, any>) {
  const res = await request({
    url: api.shanggongUrl,
    method: 'post',
    data,
  })
  return res
}

export async function reportRepairApi(data: Map<string, any>) {
  const res = await request({
    url: api.reportRepairUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getSgInfoApi(params: Map<string, any>) {
  const res = await request({
    url: api.getSgInfoUrl,
    method: 'get',
    params,
  })
  return res
}

export async function getEquipRepairPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.getEquipRepairPageUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getRepairBillApi(data: Map<string, any>) {
  const res = await request({
    url: api.getRepairBillUrl,
    method: 'post',
    data,
  })
  return res
}

export async function deleteRepairReasonApi(params: Map<string, any>) {
  const res = await request({
    url: api.deleteRepairReasonUrl,
    method: 'get',
    params,
  })
  return res
}

export async function updateRepairReasonApi(data: Map<string, any>) {
  const res = await request({
    url: api.updateRepairReasonUrl,
    method: 'post',
    data,
  })
  return res
}

export async function addRepairReasonApi(data: Map<string, any>) {
  const res = await request({
    url: api.addRepairReasonUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getRepairReasonApi(data: Map<string, any>) {
  const res = await request({
    url: api.getRepairReasonUrl,
    method: 'post',
    data,
  })
  return res
}

export async function deleteRepairPartApi(params: Map<string, any>) {
  const res = await request({
    url: api.deleteRepairPartUrl,
    method: 'get',
    params,
  })
  return res
}

export async function changeRepairPartApi(data: Map<string, any>) {
  const res = await request({
    url: api.changeRepairPartUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getRepairPartApi(data: Map<string, any>) {
  const res = await request({
    url: api.getRepairPartUrl,
    method: 'post',
    data,
  })
  return res
}

export async function addRepairPartApi(data: Map<string, any>) {
  const res = await request({
    url: api.addRepairPartUrl,
    method: 'post',
    data,
  })
  return res
}

export async function deleteEquipDocApi(params: Map<string, any>) {
  const res = await request({
    url: api.deleteEquipDocUrl,
    method: 'get',
    params,
  })
  return res
}

export async function updateEquipDocApi(data: Map<string, any>) {
  const res = await request({
    url: api.updateEquipDocUrl,
    method: 'post',
    data,
  })
  return res
}

export async function addEquipDocApi(data: Map<string, any>) {
  const res = await request({
    url: api.addEquipDocUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getEqTypesApi() {
  const res = await request({
    url: api.getEqTypesUrl,
    method: 'get',
  })
  return res
}

export async function getEqlistsPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.getEqlistsPageUrl,
    method: 'post',
    data,
  })
  return res
}

export async function getEqList(data: Map<string, any>) {
  const res = await request({
    url: api.getEqList,
    method: 'post',
    data,
  })
  return res
}
